/**
 * @(#)User.java	10:10 07/08/2013
 *
 * Copyright (c) 2013 S9,Inc.All rights reserved.
 * Created by 2013-07-08 
 */
package cn.jdy.authority.entity;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;

import cn.jdy.common.bo.BaseEntry;
import cn.jdy.framework.db.hibernate.Validator;

/**
 * 系统用户信息实体类
 *
 * @author XiaoZhenx
 * @description: 系统用户信息实体对象类，对应数据库中的S9_SYS_USER表。
 * 带(+)标示的为新增属性，为程序中表单提交和数据转换使用
 * @date 2013-07-08 10:10
 */
@Entity
public class User extends BaseEntry implements Serializable {

	private static final long serialVersionUID = 1L;
	@Id
	// 设置为主键
	@GeneratedValue(generator = "system-uuid")
	@GenericGenerator(name = "system-uuid", strategy = "uuid.hex")
	@Column(length = 32)
	private String id; // 用户标识;
	private String username; // 用户名称;
	private String organid; // 组织单位标识;
	
	@OneToOne(fetch = FetchType.EAGER)
  @JoinColumn(name = "organid",insertable = false, updatable = false)
  private Organ organ;
	
	@Transient
	private String roleid; // 角色标识(+)
	
	private String realname; // 用户真实姓名;
	@Validator
	private String passwd; // 用户密码;
	@Validator
	private String status; // 系统用户的状态，包括 启用、禁用、删除。01 启用、02 停用;默认 01
	@Transient
	private String statusname; // 状态名称(+)
	private String gender; // 性别;
	@Transient
	private String genderName; // 性别转换名称(+)
	private String tel; // 联系电话;
	private String mobile; // 移动电话;
	private String email; // e-mail;
	private String ip; // 用户绑定的IP地址。可以是多个具体的IP地址，也可以是通用IP地址（如10.152.109.*）;
	private String remark; // 备注

	@Transient
	private List<String> resourceList;// 用户可以访问的资源地址列表

	public List<String> getResourceList() {
		return resourceList;
	}

	public void setResourceList(List<String> resourceList) {
		this.resourceList = resourceList;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getOrganid() {
		return organid;
	}

	public void setOrganid(String organid) {
		this.organid = organid;
	}

	public String getRoleid() {
		return roleid;
	}

	public void setRoleid(String roleid) {
		this.roleid = roleid;
	}

	public Organ getOrgan() {
    return organ;
  }

  public void setOrgan(Organ organ) {
    this.organ = organ;
  }

  public String getRealname() {
		return realname;
	}

	public void setRealname(String realname) {
		this.realname = realname;
	}

	public String getPasswd() {
		return passwd;
	}

	public void setPasswd(String passwd) {
		this.passwd = passwd;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getStatusname() {
		return statusname;
	}

	public void setStatusname(String statusname) {
		this.statusname = statusname;
	}

	public String getGender() {
		return gender;
	}

	public void setGender(String gender) {
		this.gender = gender;
	}

	public String getGenderName() {
		return genderName;
	}

	public void setGenderName(String genderName) {
		this.genderName = genderName;
	}

	public String getTel() {
		return tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

}
